<div id="main" class="clearfix">
  <{assign var=num value=$goodsBasicInfo|count}>
  <div class="page-content">
    <div id="goods_compare" class="goods-compare table-responsive">
      <table class="compare-table table table-striped table-bordered table-hover small">
        <col class="col-1" nowarp>
        <{foreach from=$goodsBasicInfo item=goods}>
        <col class="col-2" style="width:<{0.85/ $num * 100}>%">
        <{/foreach}>
        <tbody>
          <tr>
            <th><{t}>基本信息<{/t}></th>
            <{foreach from=$goodsBasicInfo item=goods}>
            <th></th>
            <{/foreach}>
          </tr>
          <tr>
            <td><{t}>商品<{/t}></td>
            <{foreach from=$goodsBasicInfo item=goods}>
            <td class="text-center">
              <div class="goods-item">
                <div class="goods-pic"><a href="<{link app=b2c ctl=site_product arg0=$goods.product_id}>"><img src="<{$goods.image_default_id|storager:'m'}>" alt="&lt;<{$goods.name}>&gt;"></a></div>
                <div class="goods-info">
                  <h3 class="goods-name" style=""><{$goods.name}><{if $goods.spec_info}>(<{$goods.spec_info}>)<{/if}></h3>
                  <div class="goods-buy">
                    <input type="hidden" name="goods[num]" value="1">
                    <input type="hidden" name="goods[goods_id]" value="<{$goods.goods_id}>">
                    <input type="hidden" name="goods[product_id]" value="<{$goods.product_id}>">
                    <{if $goods.store <= 0 }>
                    <{button type="button" class="btn-caution action-notify" label="到货通知"}>
                    <{else}>
                    <{if $env.conf.b2c.site.buy.target == '2'}>
                    <{assign var='buytarget' value='_blank_cart'}>
                    <{elseif $env.conf.b2c.site.buy.target == '3'}>
                    <{assign var='buytarget' value='_dialog_minicart'}>
                    <{/if}>
	
                    <a class="btn btn-primary btn-sm action-addtocart" href="<{link app=b2c ctl=site_cart act=add arg0=goods arg1=$goods.goods_id arg2=$goods.product_id arg3=1}>"<{if $buytarget}> target="<{$buytarget}>"<{/if}>><span><span><{t}>加入购物车<{/t}></span></span></a><br/>

                    <{/if}>
                    <a href="<{link app=b2c ctl=site_product arg0=$goods.product_id}>" target="_blank"><span><span><{t}>Подробнее о товаре<{/t}></span></span></a> <!--查看详细-->
                  </div>
                </div>
              </div>
            </td>
            <{/foreach}>
          </tr>
          <tr>
            <td><{t}>价格<{/t}></td>
            <{foreach from=$goodsPrice item=price}>
            <td class="item-price text-center"><span><{$price.price|cur_odr}></span></td>
            <{/foreach}>
          </tr>
          <tr>
            <td><{t}>品牌<{/t}></td>
            <{foreach from=$goodsBrind item=brand_id}>
            <td><{$brand[$brand_id.brand_id]|default:'-'}></td>
            <{/foreach}>
          </tr>
          <{if $goodsWeight}>
          <tr>
            <td><{t}>重量<{/t}></td>
            <{foreach from=$goodsWeight item=weight}>
            <td><{$weight.weight|default:"-"}><{if $weight.weight}><{t}>克<{/t}><{/if}></td>
            <{/foreach}>
          </tr>
          <{/if}>
          <{if $point_status == 'on'}>
          <tr>
            <td><{t}>商品评分<{/t}></td>
            <{foreach from=$goodsPoint item=point}>
            <{if $point.point_num > 0}>
            <td>
              <em class="stars stars-<{$point.goods_point.avg_num*10}>">
                <span class="below"><i class="icon star">&#x2f;</i><i class="icon star">&#x2f;</i><i class="icon star">&#x2f;</i><i class="icon star">&#x2f;</i><i class="icon star">&#x2f;</i></span><span class="above"><i class="icon star">&#x2e;</i><i class="icon star">&#x2e;</i><i class="icon star">&#x2e;</i><i class="icon star">&#x2e;</i><i class="icon star">&#x2e;</i></span>
              </em>
              <a href="<{link app=b2c ctl=site_product arg0=$point.product_id}>#product_comment"><b><{$point.point_num}></b><{t}>条评论<{/t}></a>
            </td>
            <{else}>
            <td><{t}>暂无评论<{/t}></td>
            <{/if}>
            <{/foreach}>
          </tr>
          <{/if}>
          <tr>
            <th> <{t}>扩展属性<{/t}></th>
            <{foreach from=$goodsProps item=props}>
            <th></th>
            <{/foreach}>
          </tr>
          <{foreach from=$goodsType item=props name=name}>
          <tr>
            <td class="row-<{$smarty.foreach.name.iteration+5}>"><{$props.name}></td>
            <{foreach from=$goodsProps item=item}>
            <td><{$item.props[$props.goods_p].value|default:'-'}></td>
            <{/foreach}>
          </tr>
          <{/foreach}>

          
          <tr>
            <th> <{t}>详细参数<{/t}></th>
            <{foreach from=$goods_params item=params}>
            <th></th>
            <{/foreach}>
          </tr>

		 
          <{foreach from=$goods_params_type key=key item=value}>	
              <tr class="package-row">
                  <td class="row-<{$smarty.foreach.name.iteration+5}>"><{$key}></td>				  
                  <{foreach from=$goods_params item=item}>
                    <td><{$item.params[$value].value|default:'-'}></td>
                  <{/foreach}>
              </tr>
          <{/foreach}>

        </tbody>
      </table>
    </div>
  </div>
</div>

<div id="product_notify" class="product-notify" style="display:none;">
  <p class="desc"><{t}>该货品暂时缺货，请在下面输入您的邮箱地址或手机号码，当我们有现货供应时，我们会发送邮件通知您！<{/t}></p>
  <form class="form" method="post" action="<{link app=b2c ctl=site_product act=toNotify}>">
    <input type="hidden" name="item[0][goods_id]" value="">
    <input type="hidden" name="item[0][product_id]" value="">
    <ul>
      <li class="form-item">
        <label for="email" class="form-label"><{t}>邮箱地址<{/t}>：</label>
        <span class="form-act">
          <{input type="text" name="email" id="" size="30" vtype="required&&email"}>
        </span>
      </li>
      <li class="form-item">
        <label for="cellphone" class="form-label"><{t}>手机号码<{/t}>：</label>
        <!--<span class="form-act">
          <{input type="text" name="cellphone" id="" size="30" vtype="required"}>
        </span>-->
		<{if $phones}>
			<!--手机验证-->
			<select name="phone_setting" id="quhao" style="border: 1px solid #ccc;padding: 10px;">
				<{foreach from=$phones item=items}>
				<option sid="<{$items.length}>" value="<{$items.area}>"><{$items.country}><{$items.area}></option>
				<{/foreach}>
			</select>
				<{input type="text" name="cellphone" id="" size="30" vtype="required"}>
		<{else}>
			<span class="form-act">
				<{input type="text" name="cellphone" id="" size="30" vtype="required"}>
			</span>
		<{/if}>
      </li>
      <li class="form-item form-item-last">
        <label class="form-label"></label>
        <span class="form-act">
          <{button type="submit" class="btn-caution" label=$___b2c="提交"|t:'b2c' rel="_request"}>
        </span>
      </li>
    </ul>
  </form>
</div>
<script>
$$('.action-notify').addEvent('click', function(e){
    var parent = this.getParent('.goods-item');
    var dialog = new Dialog($('product_notify').wrapped(), {
        title:'<{t}>到货通知<{/t}>',
        width: 600,
        modal: {
            'class': 'cover'
        },
        onLoad: function(){
            var dialog = this;
            var content = this.content;
            content.getElement('input[name="item[0][goods_id]"]').value = parent.getElement('input[name="goods[goods_id]"]').value;
            content.getElement('input[name="item[0][product_id]"]').value = parent.getElement('input[name="goods[product_id]"]').value;
            content.getElement('[rel=_request]').store('_ajax_config',{onSuccess:function(rs){
                if(rs && rs[0]) {
                    if(rs[0]['true']) {
                        content.getElement('.product-notify').innerHTML = '<div class="success"><{t}>联系方式已经成功提交，到货后会立刻通知您。<{/t}></div>';
                        dialog.hide.delay(3000, dialog);
                    }
                }
            }});
        }
    });
});
</script>
